---
layout: default
---

<div class="page clearfix" post>
    <div class="left">
        <h1>{{page.title}}</h1>
        <div class="label">

            <div class="label-card">
                <i class="fa fa-calendar"></i>{{ page.date | date: "%F" }}
            </div>

            <div class="label-card">
                {% if page.author %}<i class="fa fa-user"></i>{{ page.author }}
                {% endif %}
            </div>

            <div class="label-card">
                {% if page.meta %}<i class="fa fa-key"></i>{{ page.meta }}  {% endif %}
            </div>

            <div class="label-card">
            {% include category.html %}
            </div>

            <div class="label-card">
            {% include tag.html %}
            </div>

        </div>
        <hr>
        <article itemscope itemtype="http://schema.org/BlogPosting">
        {{content}}
        </article>
        <hr>

        {% assign hasSimilar = '' %}
        {% for post in site.related_posts %}
            {% assign postHasSimilar = false %}
            {% for tag in post.tags %}
                {% for thisTag in page.tags %}
                    {% if postHasSimilar == false and hasSimilar.size < 6 and post != page and tag == thisTag %}
                        {% if hasSimilar.size == 0 %}
                        <h2 id="similar_posts">Similar Posts</h2>
                        <ul>
                        {% endif %}
                        <li class="relatedPost">
                            <a href="{{ site.baseurl }}{{ post.url }}">{{ post.title }}
                            {% if post.series %}
                                (Series: {{ post.series }})
                            {% endif %}
                            </a>
                        </li>
                        {% capture hasSimilar %}{{ hasSimilar }}*{% endcapture %}
                        {% assign postHasSimilar = true %}
                    {% endif %}
                {% endfor %}
            {% endfor %}
        {% endfor %}
        {% if hasSimilar.size > 0 %}
            </ul>
        {% endif %}

        {% include previousAndNext.html %}
        <!-- 评论插件 -->
       <!-- <h2 id="comments">Comments</h2>-->
      <!--  {% include comments.html %}-->


    </div>
    <button class="anchor"><i class="fa fa-anchor"></i></button>
    <div class="right">
        <div class="wrap">

            <!-- Content -->
            <div class="side content">
                <div>
                    Content
                </div>
                <ul id="content-side" class="content-ul">
                    {% if hasSimilar.size > 0 %}
                    <li><a href="#similar_posts">Similar Posts</a></li>
                    {% endif %}
                    
                    
                </ul>
            </div>
            <!-- 其他div框放到这里 -->
            <!-- <div class="side">bbbb</div> -->
        </div>
    </div>
</div>
<script>
/**
 * target _blank
 */
(function() {
    var aTags = document.querySelectorAll('article a:not([id])')
    for (var i = 0; i < aTags.length; i++) {
        aTags[i].setAttribute('target', '_blank')
    }
}());
</script>
<script src="{{ "/js/pageContent.js " | prepend: site.baseurl }}" charset="utf-8"></script>
